package com.hyperboost.deepseek.config;

import com.hyperboost.deepseek.store.DeepSeekStore;
import dev.langchain4j.memory.chat.ChatMemoryProvider;
import dev.langchain4j.memory.chat.MessageWindowChatMemory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DeepSeekConfig {

    @Autowired
    public DeepSeekStore deepSeekStore;

    @Bean
    public ChatMemoryProvider chatMemoryProvider() {
        return memoryId ->
                MessageWindowChatMemory.builder()
                        .id(memoryId)
                        .maxMessages(50)
                        .chatMemoryStore(deepSeekStore)
                        .build();
    }
}
